<?
if(!isset($_SESSION['tongsp']))
    $_SESSION['tongsp']=0;
?>
<script type="text/javascript">
    function fcheck()
    {
        with(frm_search_pro)
        {
            if(pname.value==""|pname.value=="Từ khóa...")
            {
                alert("Bạn phải nhập ít nhất 1 kí tự");
                pname.focus();
                return false;
            }
            else
            return true;
        }
    }
</script>
<div class="left_menu">
    <div class="shopping_cart">
        <div id="detail_cart">Giỏ hàng: <span style="color: yellow;"><?=$_SESSION['tongsp']?></span>  Sản phẩm</div>
        <a href="<?=PATH?>/shoppingcart"><div class="cart_view"></div></a>
        <a href="#"><div class="cart_send"></div></a>
       </div>
    <div class="search_header">Tìm sản phẩm</div>
    <div id="search_form">
        <form action="<?=PATH?>/product/search" method="post" name="frm_search_pro" onsubmit="return fcheck();">
            <div class="search_input">

                <input type="text" name="pname" value="<?=$_POST['pname']==''?'Từ khóa...':$_POST['pname']?>" onclick="this.value=''" />

                <select name="menupro">
                    <option value="0">--Danh mục sản phẩm--</option>
                    <?foreach($this->listmenuproduct as $menu=>$list){?>
                    <option value="<?=$list->pfid?>"><?=$list->pfname?></option>
                    <?}?>
                </select>
                <select name="manufactory">
                    <option value="0">--Hãng sản xuất--</option>
                    <?foreach($this->listmanufacture as $manu=>$list){?>
                    <option value="<?=$list->mfid?>"><?=$list->mfname?></option>
                    <?}?>
                </select>
            </div>
                <div class="block_but">
                    <input type="submit" name="btsearch" value="Tìm kiếm" >
                </div>

        </form>
    </div>
    <?php foreach($this->listmenusys as $sys=>$listsys)
    {?>
        <div class="menuleft_content">
        <div class="prod_menu_boss">
            <div class="menuname"> <a href="<?=PATH?>/product/viewall/<?=$listsys->menuid?>"><?=$listsys->menuname?></a></div>
         </div>
            <? foreach($this->listmenuproduct as $menu=>$list)
    {?>
        <?if($list->menuid==$listsys->menuid){?>
        <div class="prod_menu">
            <a href="<?=PATH?>/product/<?=$list->pfid?>"><?=$list->pfname?></a>
        </div>
        <?
    }
    }
?>
        </div>
<?}?>
    <div class="prod_menu_boss">Tin tức</div>
    <div id="left_news">
        <?foreach($this->listnews as $key=>$value){?>
        <div>
            <a href="<?=PATH?>/news/detail/<?=$value->newsid?>">
                <img src="<?=PATH?>/media/images/news/<?=$value->image?>" alt="<?=$value->title?>">
                <?=$value->title?>
            </a>

        </div>
            <?}?>
    </div>
    <div class="prod_menu_boss">Thông tin thị trường</div>
    <iframe title="Thị trường" src="<?=PATH?>/thitruong/thitruong.php" width="240px" height="240px" frameborder="0" scrolling="no"></iframe>
    <div class="prod_menu_boss">Thống kê</div>
    <div class="prod_menu_boss">Giờ làm việc</div>
    <div align="center">
        <div id="Div1" class="box" style="padding-top:10px;">

            <table style="margin:0px 15px 0px 12px; width:90%; color: #ffffff;">
                <tbody><tr><td class="stat_txt"><h5> Sáng : 8h  - 12h</h5> </td>
                </tr><tr><td class="stat_txt"><h5>Buổi chiều : 13h - 18h</h5> </td>
                </tr><tr><td class="stat_txt"><b><h5>Chủ nhật, ngày lễ Nghỉ</h5></b> </td>

                    <!-- ------------------------------------------------------------- -->

                    <!-- ------------------------------------------------------------- -->
                </tr></tbody></table>
        </div>
    </div>
</div>
    <div class="box_content">
        <div id="main_logo">
            <img src="<?=PATH?>/media/images/background/LOGO_Lexus.png" alt="" />
            <img src="<?=PATH?>/media/images/background/LOGO_Mitsu.png" alt="" />
            <img src="<?=PATH?>/media/images/background/LOGO_Toy.png" alt="" />
        </div>